<?php declare(strict_types=1);


namespace App\Model\Entity;

use Swoft\Db\Annotation\Mapping\Column;
use Swoft\Db\Annotation\Mapping\Entity;
use Swoft\Db\Annotation\Mapping\Id;
use Swoft\Db\Eloquent\Model;


/**
 * 邀请码表
 * Class InviteCode
 *
 * @since 2.0
 *
 * @Entity(table="invite_code")
 */
class InviteCode extends Model
{
    /**
     * 
     * @Id()
     * @Column()
     *
     * @var int
     */
    private $id;

    /**
     * 用户id
     *
     * @Column(name="member_id", prop="memberId")
     *
     * @var int
     */
    private $memberId;

    /**
     * 类型 1:永久(普通用户) 2:临时(官方) 3:红人 4:商户 5渠道
     *
     * @Column()
     *
     * @var int|null
     */
    private $type;

    /**
     * 邀请码
     *
     * @Column()
     *
     * @var string|null
     */
    private $code;

    /**
     * 开始时间
     *
     * @Column(name="start_time", prop="startTime")
     *
     * @var int|null
     */
    private $startTime;

    /**
     * 结束时间
     *
     * @Column(name="end_time", prop="endTime")
     *
     * @var int|null
     */
    private $endTime;

    /**
     * 1:正常 0:删除
     *
     * @Column()
     *
     * @var int|null
     */
    private $status;

    /**
     * 创建时间
     *
     * @Column(name="created_at", prop="createdAt")
     *
     * @var int|null
     */
    private $createdAt;

    /**
     * 修改时间
     *
     * @Column(name="updated_at", prop="updatedAt")
     *
     * @var int|null
     */
    private $updatedAt;


    /**
     * @param int $id
     *
     * @return void
     */
    public function setId(int $id): void
    {
        $this->id = $id;
    }

    /**
     * @param int $memberId
     *
     * @return void
     */
    public function setMemberId(int $memberId): void
    {
        $this->memberId = $memberId;
    }

    /**
     * @param int|null $type
     *
     * @return void
     */
    public function setType(?int $type): void
    {
        $this->type = $type;
    }

    /**
     * @param string|null $code
     *
     * @return void
     */
    public function setCode(?string $code): void
    {
        $this->code = $code;
    }

    /**
     * @param int|null $startTime
     *
     * @return void
     */
    public function setStartTime(?int $startTime): void
    {
        $this->startTime = $startTime;
    }

    /**
     * @param int|null $endTime
     *
     * @return void
     */
    public function setEndTime(?int $endTime): void
    {
        $this->endTime = $endTime;
    }

    /**
     * @param int|null $status
     *
     * @return void
     */
    public function setStatus(?int $status): void
    {
        $this->status = $status;
    }

    /**
     * @param int|null $createdAt
     *
     * @return void
     */
    public function setCreatedAt(?int $createdAt): void
    {
        $this->createdAt = $createdAt;
    }

    /**
     * @param int|null $updatedAt
     *
     * @return void
     */
    public function setUpdatedAt(?int $updatedAt): void
    {
        $this->updatedAt = $updatedAt;
    }

    /**
     * @return int
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return int
     */
    public function getMemberId(): ?int
    {
        return $this->memberId;
    }

    /**
     * @return int|null
     */
    public function getType(): ?int
    {
        return $this->type;
    }

    /**
     * @return string|null
     */
    public function getCode(): ?string
    {
        return $this->code;
    }

    /**
     * @return int|null
     */
    public function getStartTime(): ?int
    {
        return $this->startTime;
    }

    /**
     * @return int|null
     */
    public function getEndTime(): ?int
    {
        return $this->endTime;
    }

    /**
     * @return int|null
     */
    public function getStatus(): ?int
    {
        return $this->status;
    }

    /**
     * @return int|null
     */
    public function getCreatedAt(): ?int
    {
        return $this->createdAt;
    }

    /**
     * @return int|null
     */
    public function getUpdatedAt(): ?int
    {
        return $this->updatedAt;
    }

}
